package com.vimi8.ebb.auth.model;

import net.sf.json.JSONArray;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by think on 2016/12/26.
 */
public class UserOrg {
    //clientId
    private String clientId;
    //组织名字
    private String orgName;
    private String job;
    //组织类型
    private String orgClass;
    //组织类型名字
    private String orgClassName;
    private int orgClassType;

    private List<String> orgImages=new ArrayList<>();
    public UserOrg() {
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public int getOrgClassType() {
        return orgClassType;
    }

    public void setOrgClassType(int orgClassType) {
        this.orgClassType = orgClassType;
    }

    public List<String> getOrgImages() {
        return orgImages;
    }

    public void setOrgImages(String orgImages) {
        if(StringUtils.isEmpty(orgImages)){
            this.orgImages=new ArrayList<>();
        }else{
            JSONArray jsonArray=JSONArray.fromObject(orgImages);
            List<String> list=jsonArray.toList(jsonArray,String.class);
            this.orgImages = list;
        }
    }

    public String getOrgClass() {
        return orgClass;
    }

    public void setOrgClass(String orgClass) {
        this.orgClass = orgClass;
    }

    public String getOrgClassName() {
        return orgClassName;
    }

    public void setOrgClassName(String orgClassName) {
        this.orgClassName = orgClassName;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    @Override
    public String toString() {
        return "UserOrg{" +
                "clientId='" + clientId + '\'' +
                ", orgClass='" + orgClass + '\'' +
                ", orgClassName='" + orgClassName + '\'' +
                ", orgClassType='" + orgClassType + '\'' +
                ", orgImages=" + orgImages +
                '}';
    }
}
